/*-------------------------------------------------------------------------
	created:	2010/09/16  17:50
	filename: 	e:\Project_SVN\Server\GamesScene\GameScene.h
	author:		Deeple

	purpose:
---------------------------------------------------------------------------*/
#pragma  once

#include "../Interface/GameHandle.h"
#include "../Interface/ObjectHandle.h"
#include "../CustomDefine/CustomMessage.h"

#define GameInterface GameInteract2

extern IGame* g_pGame;

class GameInterface : public ICallee
{
    // 对象被创建
	virtual void OnCreate(IGame* pScene, UI32 self);

	// 对象被销毁
	virtual void OnDestroy(IGame* pScene, UI32 self, bool bSysRunning);

	// 对象的侦循环
	virtual void OnFrame(IGame* pScene, UI32 self, UI32 selfType, UI32 nFrame, OBJ_POSI_INFO* info);

	// 对象的心跳
	virtual void OnHeartBeat(IGame* pScene, UI32 self, UI32 selfType, UI32 nBeat, OBJ_POSI_INFO* info);

	// 对象收到命令
	virtual void OnCommand(IGame* pScene, UI32 sender, UI32 self, UI32 msgType, CMsgTyped* pmsg);

	// 对象收到定时器消息
	virtual void OnTimer(IGame* pScene, UI32 self, UI32 timerId, UI32 interval_minisec, CMsgTyped* pmsg);

	// 返回接口类型供底层识别
	virtual const char* GetInterfaceName(){return "GameInteract2";}
};

extern GameInterface g_eventhandle;
